Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selam Ainalem Brittany Jones #22

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Conversation

SelamawitA
Copy link

Video Store API

Congratulations! You're submitting your assignment!
If you didn't get to the functionality the question is asking about, reply with what you would have done if you had completed it.

Comprehension Questions

Question Answer
Explain how you came up with the design of your ERD, based on the seed data. We looked for references between the data to guide the relationships that would be necessary to import the seed data. Also, thinking about how movie rentals play out in the real world helped with ERD design. Describe a set of positive and negative test cases you implemented for a model.

Describe a set of positive and negative test cases you implemented for a model. | For the rental model we tested for a case in which all required values were provided movie ID and customer ID. To test for a negative case we simulated a post action in which the customer ID, and also the movie Id was not provided.
Describe a set of positive and negative test cases you implemented for a controller. | For the get movie path we tested for an existing movie and for a non existing movie. An existing movie returned a hash with all movie information, and a non existing movie returned 404 not found
How does your API respond when bad data is sent to it? | In the case for a request to check_out a movie with a customer_id that does not exist, the API will respond with an error json, that sends back a message that the customer’s id is missing.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. | The reduction of available inventory is kept in a model method. Updating and saving an active record model seemed like business logic that should be kept outside of the controller.
Do you have any recommendations on how we could improve this project for the next cohort? | For the next cohort, I think there should be more instruction on using Smoke tests, and RABL.
Link to Trello | https://trello.com/b/vNEXohNE/video-store-api
Link to ERD | https://www.lucidchart.com/documents/edit/53439e24-0646-4b9e-acfc-5691c657c1a5/0?shared=true&existing=1&docId=53439e24-0646-4b9e-acfc-5691c657c1a5

@CheezItMan
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good commit messages, good number of commits, both team members contributed.
Comprehension questions Check, but please don't break the table formatting next time.
General
Business Logic in Models Check,
All required endpoints return expected JSON data Check
Requests respond with appropriate HTTP Status Code Check
Errors are reported Check
Testing
Passes all Smoke Tests Check
Model Tests - all relations, validations, and custom functions test positive & negative cases You are missing some business logic tests.
Controller Tests - URI parameters and data in the request body have positive & negative cases You are missing one serious test, for what happens when someone tries to check in a movie they haven't checked out.
Overall Overall well done, you hit all the major learning goals. Check my notes on your testing, as you missed a few things. Congratulations, you've finished Rails!


}.must_change 'Movie.count', 1

JSON.parse(response.body)["id"].must_equal 1072689925

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing because you can't really guantee the ID the test is going to generate, it probably doesn't need to be there.

Better would be:
JSON.parse(response.body).keys.must_include "id"

movie.errors.messages.must_include :release_date
end

it "must have title" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be repetitive

end

describe 'a_check_in' do
it 'must increase inventory by 1' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about checking in a movie that's not checked out?

end
end

describe "relations" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Business logic tests?

@@ -0,0 +1,226 @@
require "test_helper"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about what happens when you try to check in a movie that's not checked out by that customer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants